home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / vdtj122b.zip / DEMO6.VDM < prev    next >
Text File  |  1992-11-30  |  6KB  |  155 lines

  1. RI(9)/VEDIT Family - Keystroke Macros/
  2. M(H)            !Display header
  3.  
  4. YT/
  5. Keystroke macros let you assign a commonly typed sequence of keys to a single
  6. key.  Pressing that single key then types the whole sequence - saving you
  7. time and reducing the chances for error.
  8.  
  9. For example, if you were repeatedly typing the phrase "attached and included
  10. herein by reference", you could define the key <Ctrl-A> to type out the
  11. whole phrase each time it was pressed.
  12.  
  13. Keystroke macros are also used to set up "hot keys" for accessing the menu
  14. functions directly.  This speeds editing for the experienced user.
  15.  
  16. With VEDIT PLUS, keystroke macros have the additional capability of accessing
  17. the powerful Command Mode macro language.  This lets you create almost any edit
  18. function you might want.
  19.  
  20. You can set up as many keystroke macros as you like.  Keystroke macros can be
  21. "temporary" or can be built permanently into the editor.
  22.  
  23. /
  24. M(K)
  25.  
  26. 9XS(100)        !Need 9 line window
  27. M(W)            !Create instruction window; set attributes
  28. EZY            !Empty edit buffer
  29. EB demo.txt        !Load demo file
  30. Z            !Goto end-of-file
  31.  
  32. EE(1)
  33. B#K
  34. I/In this example keystroke macro, you will assign the words "VEDIT PLUS" to the
  35. key <Ctrl-A>.  <Alt-K> is itself a keystroke macro ("hot key") which accesses
  36. the {MISC, Keyboard layout, Record macro} function.
  37.  
  38. Press <Alt-K>.  At the prompt press <Ctrl-A> and then <Esc>.  You are now in
  39. "Record Mode" - note the status line.  Type "VEDIT PLUS".  Press <Alt-K> again
  40. to turn off record mode.  Press <Ctrl-A>.  If all went well, the words "VEDIT
  41. PLUS" will appear.
  42.         --- Press <Esc> to continue ---/
  43. B -V
  44. EE(@)
  45. V
  46.  
  47. EE(1)
  48. B#K
  49. I/Many pre-configured keystroke macros directly access functions in the menu
  50. system as "hot keys".  For example, <Alt-F3> is configured to perform [MENU],
  51. select the {GOTO} sub-menu and select the "Matching ()" function.  Therefore,
  52. we say that <Alt-F3> is a "hot key" for {GOTO, Matching ()}.
  53.  
  54. You can view all of the active keystroke macros by entering the {MISC} sub-
  55. menu (press <Alt-M>), selecting the "Keyboard Layout" sub-menu and selecting
  56. "Display Layout".  Note that the last displayed macro is for "^A" which you
  57. just added.    --- Press <Esc> to continue ---/
  58.  
  59. B -V
  60. EE(@)
  61. V
  62.  
  63. EE(1)
  64. B#K
  65.  
  66. I/Now lets add another "hot key" to directly access the {HELP, Status display}
  67. function.  We will assign it to <Ctrl-F1>.  Menus and most menu functions can
  68. simply be selected by their first letter.
  69.  
  70. Press <Alt-K>.  At the prompt press <Ctrl-F1> and then <Esc>.  Now press
  71. press <F10>, then "H", then "S".  Press <Alt-K> again to turn off the record
  72. mode.  Try out the new keystroke macro by pressing <Ctrl-F1>.  The pop-up
  73. status display should appear.
  74.         --- Press <Esc> to continue ---/
  75. B -V
  76. EE(@)
  77. V
  78.  
  79. EE(1)
  80. B#K
  81. I/Display the keystroke macros again using {MISC, Keyboard layout, Display}.
  82. Note that the new "Ctrl-F1" is assigned "[MENU]-HS".  Therefore, <Ctrl-F1>
  83. is the same as pressing the [MENU] key, then "H" and then "S".
  84.  
  85. VEDIT remembers keystroke macros in terms of the functions they access, e.g.
  86. [MENU], and NOT the keys assigned to the functions, e.g. <F10>.  This way,
  87. should the keyboard layout change (e.g. you assign a different key to [MENU]),
  88. all existing keystroke macros will still work.
  89.         --- Press <Esc> to continue ---/
  90. B -V
  91. EE(@)
  92. V
  93.  
  94. EE(1)
  95. B#K
  96. I/You can also enter new keystrokes by using {MISC, Keyboard layout, Add macro}
  97. (assigned to <Ctrl-K>).  Instead of recording your keystrokes while you edit,
  98. you enter the keystrokes directly into a window.  This method if preferable
  99. for keystroke macros which access VEDIT PLUS's macro language.
  100.  
  101. Lets redo our first example using this method.  Press <Ctrl-K>.  At the first
  102. prompt press <Ctrl-A> and <Esc>.  Press "Y" to confirm.  At the second prompt
  103. type "VEDIT PLUS" and press <Esc>.  Now press <Ctrl-A> to test it.  "VEDIT
  104. PLUS" should again appear.        --- Press <Esc> to continue ---/
  105. B -V
  106. EE(@)
  107. V
  108.  
  109. EE(1)
  110. B#K
  111. I/Now lets use VEDIT PLUS's macro language to create an editing function to
  112. delete characters from the beginning of the line up to the cursor:
  113.  
  114. Press <Ctrl-K>.  At the first prompt press <Ctrl-W>.  Then press <Esc>.  At
  115. the second prompt first press <Ctrl-E> (this is the [VISUAL EXIT] function).
  116. Then type (without quotes) "0K".  Then press <Esc> again.
  117.  
  118. Move the cursor to the middle of a line and press <Ctrl-W>.  The characters
  119. before the cursor will be deleted.   --- Press <Esc> to continue ---/
  120.  
  121. B -V
  122. EE(@)
  123. V
  124.  
  125. EE(1)
  126. B#K
  127. I/This keystroke macro also uses VEDIT PLUS's macro language to create an
  128. editing function to duplicate a line of text:
  129.  
  130. Press <Ctrl-K>.  At the prompt press <Ctrl-D>.  Then press <Esc>.  At the
  131. second prompt first press <Ctrl-E>.  Then type (without quotes) "0L G". Then
  132. press <Esc> again.
  133.  
  134. Press <Ctrl-D>. If all went well, the current line of text will be duplicated.
  135.         --- Press <Esc> to continue ---/
  136. B -V
  137. EE(@)
  138. -L -@$N/|S|A/ 0L    !Position cursor
  139. V
  140.  
  141. EE(1)
  142. B#K
  143. I/The function {CONFIG, Save into VEDIT} can be used to save new keystroke
  144. macros (and other configuration changes) permanently into VEDIT.
  145.  
  146. You can also save the entire keyboard layout, with all keystroke macros, to
  147. a disk file using {MISC, Keyboard layout, Save to disk}.  This file can
  148. easily be edited and loaded back into VEDIT.  Therefore, you can change the
  149. keyboard layout by using the {MISC, Keyboard layout} sub-menu or by editing
  150. and loading keyboard configuration files.
  151.           --- Press <Esc> to return to the Main Menu ---/
  152. B -V
  153. EE(@)
  154. V
  155.